// source --> https://ipo-beginner.com/wp-content/plugins/wordpress-popular-posts/public/js/wpp-4.2.0.min.js?ver=4.2.0 var WordPressPopularPosts=function(){var d=function(){},f=function(b,e,a,d){var c=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");b=-1!=["GET","POST"].indexOf(b)?b:"GET";c.open(b,e+("GET"==b?"?"+a:""),!0);"POST"==b&&c.setRequestHeader("Content-type","application/x-www-form-urlencoded");c.setRequestHeader("X-Requested-With","XMLHttpRequest");c.onreadystatechange=function(){4===c.readyState&&200===c.status&&"function"===typeof d&&d.call(void 0,c.response)};c.send("POST"== b?a:null)};return{get:function(b,e,a){a="function"===typeof a?a:d;f("GET",b,e,a)},post:function(b,e,a){a="function"===typeof a?a:d;f("POST",b,e,a)},ajax:f}}(); if("undefined"!==typeof wpp_params && wpp_params.ID > 0){var do_request=!0;if("1"==wpp_params.sampling_active){var num=Math.floor(Math.random()*wpp_params.sampling_rate)+1;do_request=1===num}do_request&&WordPressPopularPosts.post(wpp_params.ajax_url,"_wpnonce="+wpp_params.token+"&wpp_id="+wpp_params.ID+"&sampling="+wpp_params.sampling_active+"&sampling_rate="+wpp_params.sampling_rate,function(d){wpp_params.debug&&window.console&&window.console.log&&window.console.log(d)})}; // source --> https://ipo-beginner.com/wp-content/plugins/enhanced-categories/js/enhanced-categories.js function EnhancedCategoriesPlugin() { this._settings = { expandText : '»', contractText : '«', leafText : '-', expandImage : '', contractImage : '', leafImage : '', buttonColor : '#CC0000', buttonWidth : '10px', buttonMargin : '0 5px 0 0', isButtonAfter : false }; } jQuery.extend(EnhancedCategoriesPlugin.prototype, { setSettings: function(newSettings) { jQuery.extend(this._settings, newSettings || {}); }, getSettings: function() { return this._settings; }, getButtonText: function(text, image) { var output = ''; if (image=='') { output += text; } else { output += '' + text + ''; } return output; } }); jQuery(document).ready(function() { enhancedCategoriesPlugin = new EnhancedCategoriesPlugin(); }); jQuery.fn.enhancedCategories = function(args) { var defaults = enhancedCategoriesPlugin.getSettings(); jQuery.extend(defaults, args); return jQuery('li.cat-item', this).each(function() { var childrenUl = jQuery(this).children('ul'); var hasChildren = (childrenUl.length > 0); var button = ''; // Add some padding to the RSS images jQuery('img', this) .css({ margin: '0 5px', padding: '0' }); // Make button text if (hasChildren) { if (defaults.contractChildren==1) { button += ''; button += enhancedCategoriesPlugin.getButtonText(defaults.expandText, defaults.expandImage); button += ''; } else { button += ''; button += enhancedCategoriesPlugin.getButtonText(defaults.contractText, defaults.contractImage); button += ''; } } else { button += ''; button += enhancedCategoriesPlugin.getButtonText(defaults.leafText, defaults.leafImage); button += ''; } // Add the button before or after the category if (defaults.isButtonAfter) { if (hasChildren) { jQuery(this).children('ul').before(button); } else { jQuery(this).append(button); } } else { jQuery(this).prepend(button); } // Behaviour of the category jQuery(this) .css({listStyleType: 'none'}) .children('span.button') .css({ width: defaults.buttonWidth, margin: defaults.buttonMargin, color: defaults.buttonColor }) .click(function() { jQuery(this) .siblings('ul') .slideToggle() .end() .each(function() { if (jQuery(this).hasClass('is_expanded')) { jQuery(this) .html(enhancedCategoriesPlugin.getButtonText(defaults.contractText, defaults.contractImage)) .removeClass('is_expanded') .addClass('is_contracted'); } else { jQuery(this) .html(enhancedCategoriesPlugin.getButtonText(defaults.expandText, defaults.expandImage)) .removeClass('is_contracted') .addClass('is_expanded'); } return this; }); }); jQuery(this).children('ul') .css({ paddingLeft: defaults.buttonWidth }); // Contract child categories if asked if (defaults.contractChildren==1) { jQuery(this).children('ul').hide(); } return this; }); };